define("pandora/dialog/1.0.0/confirm-debug", [ "./dialog-debug", "pandora/overlay/1.0.0/overlay-debug", "$-debug", "pandora/widget/1.0.0/widget-debug", "pandora/base/1.0.0/base-debug", "pandora/class/1.0.0/class-debug", "pandora/events/1.0.0/events-debug", "pandora/locker/1.0.0/locker-debug", "./mask-debug" ], function(require, exports, module) {
    /**
 * 对话框
 *
 * @module Dialog
 */
    "use strict";
    var Dialog = require("./dialog-debug");
    /**
 * Confirm
 * @class Confirm
 * @extends Dialog
 * @constructor
 */
    var Confirm = Dialog.extend({
        defaults: {
            mask: true,
            data: {
                cancel: '<span class="btn btn-default">取消</span>',
                submit: '<span class="btn btn-primary">确定</span>',
                title: "确认"
            }
        },
        setup: function() {
            var self = this;
            self.initDelegates({
                "click [data-role=submit]": function(e) {
                    e.preventDefault();
                    this.fire("submit") !== false && this.close();
                },
                "click [data-role=cancel]": function(e) {
                    e.preventDefault();
                    this.fire("cancel") !== false && this.close();
                }
            });
            if (!self.option("trigger")) {
                self.hide(function() {
                    this.destroy();
                });
            }
            Confirm.superclass.setup.apply(self);
        },
        submit: function(callback) {
            if (callback) {
                return this.on("submit", callback);
            } else {
                return this.fire("submit");
            }
        },
        cancel: function(callback) {
            if (callback) {
                return this.on("cancel", callback);
            } else {
                return this.fire("cancel");
            }
        }
    });
    module.exports = Confirm;
});
